#pragma once

#include <AVUIEffect.h>
#include <AVUIColor.h>

namespace AVUI {

class DropShadowEffect : public Effect
{
public:
    DECLARE_ELEMENT(DropShadowEffect, Effect);

    DropShadowEffect();

    float get_BlurRadius() const { return m_blurRadius; }
    void set_BlurRadius(float value) { SetValue(get_BlurRadiusProperty(), AVUI::BoxValue(value)); } 
    DECLARE_DEPENDENCY_PROPERTY(BlurRadius);

    Color get_Color() const { return m_color; }
    void set_Color(const Color& value) { SetValue(get_ColorProperty(), AVUI::BoxValue(value)); } 
    DECLARE_DEPENDENCY_PROPERTY(Color);

    float get_Direction() const { return m_direction; }
    void set_Direction(float value) { SetValue(get_DirectionProperty(), AVUI::BoxValue(value)); } 
    DECLARE_DEPENDENCY_PROPERTY(Direction);

    float get_Opacity() const { return m_opacity; }
    void set_Opacity(float value) { SetValue(get_OpacityProperty(), AVUI::BoxValue(value)); } 
    DECLARE_DEPENDENCY_PROPERTY(Opacity);

    RenderingBias::Enum get_RenderingBias() { return (RenderingBias::Enum)(AVUI::UnboxValue<int>(GetValue(get_RenderingBiasProperty()))); }
    void set_RenderingBias(RenderingBias::Enum value) { SetValue(get_RenderingBiasProperty(), AVUI::BoxValue<int>(value)); } 
    DECLARE_DEPENDENCY_PROPERTY(RenderingBias);

    float get_ShadowDepth() const { return m_shadowDepth; }
    void set_ShadowDepth(float value) { SetValue(get_ShadowDepthProperty(), AVUI::BoxValue(value)); } 
    DECLARE_DEPENDENCY_PROPERTY(ShadowDepth);

protected:

    virtual TRefCountedPtr<Freezable> CreateInstanceCore() AVUI_OVERRIDE { return object_allocate<DropShadowEffect>().get_Ptr(); }

private:

    static void StaticConstructor();

    static void BlurRadiusPropertyChanged(DependencyObject* d, DependencyPropertyChangedEventArgs* e);
    static void OpacityPropertyChanged(DependencyObject* d, DependencyPropertyChangedEventArgs* e);
    static void ColorPropertyChanged(DependencyObject* d, DependencyPropertyChangedEventArgs* e);
    static void ShadowDepthPropertyChanged(DependencyObject* d, DependencyPropertyChangedEventArgs* e);
    static void DirectionPropertyChanged(DependencyObject* d, DependencyPropertyChangedEventArgs* e);

    float m_blurRadius;
    Color m_color;
    float m_direction;
    float m_opacity;
    float m_shadowDepth;
};

}; // namespace AVUI
